/**
 * Created by wzh on 2016/8/16.
 */
"use strict";
swan_pc
    .factory('UserProfile',function($resource,DateUtils){
        return $resource('/api/user-profiles/:pid',{pid:'@pid'},{
            'query':{
                method: 'GET',
                isArray:true
            },
            'get': {
                method: 'GET',
                transformResponse: function (data) {
                    data = angular.fromJson(data);
                    //data.birthDate = DateUtils.convertLocaleDateFromServer(data.birthDate);
                    return data;
                }
            },
            'update': {
                method: 'PUT',
                transformRequest: function (data) {
                    //data.baseInfo.birthDate = DateUtils.convertLocaleDateToServer(data.baseInfo.birthDate);
                    return angular.toJson(data);
                }
            },
            'queryMe':{
                method: 'GET',
                url:"/api/user-profiles/my"
            },
            'delete':{
                method:'DELETE'
            }
        })
    })